Skip to content

Fix spec-drift false positives from date-only description changes#49

Merged
splch merged 8 commits into
mainfrom
copilot/update-openapi-spec-client
May 27, 2026
Merged

Fix spec-drift false positives from date-only description changes#49
splch merged 8 commits into
mainfrom
copilot/update-openapi-spec-client

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

Summary

The weekly spec-drift workflow was firing on a date-only change in info.description (*Last updated: May 15, 2026*May 22, 2026), with no actual API surface changes.

  • spec-drift.yml — adds a norm() shell helper that runs jq -S 'del(.info.description)' to sort keys and drop the description field in one step, then uses <(norm openapi.json) and <(norm /tmp/latest-spec.json) in the existing diff one-liner. Date bumps (and any other description-only changes) no longer open false-positive issues; real schema/endpoint changes still trigger the alert.

openapi.json is left unchanged — since the workflow now ignores description-only diffs, updating the vendored date is unnecessary and keeps the diff minimal.

Test plan

Verified the norm() logic in isolation: date-only deltas produce no diff; non-date changes (e.g. title rename) still surface correctly. All 242 unit tests pass at 100% branch coverage.


Important

Most code in ionq_core/ is auto-generated and overwritten on regeneration.
See CONTRIBUTING.md for which files are safe to edit.

Copilot AI linked an issue May 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update client for changed OpenAPI spec Fix spec-drift false positives from date-only description changes May 25, 2026
Copilot finished work on behalf of splch May 25, 2026 17:52
Copilot AI requested a review from splch May 25, 2026 17:52
Copy link
Copy Markdown
Collaborator

@splch splch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the git diff needs to be as small as possible

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

the git diff needs to be as small as possible

Reverted the openapi.json date change in 87d6d29 — since spec-drift.yml now strips the *Last updated:* line before diffing, there's no need to update the vendored spec. The PR now only touches spec-drift.yml.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • releases.astral.sh
    • Triggering command: /home/REDACTED/.local/bin/uv uv run pytest tests/ -x -q --ignore=tests/integration (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of splch May 25, 2026 17:58
Copilot AI requested a review from splch May 25, 2026 17:58
Copy link
Copy Markdown
Collaborator

@splch splch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoring or removing the date from the openapi spec should be a short addition to the existing one-liner. iterate a bit on your implementation until it's as short and simple as possible.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

ignoring or removing the date from the openapi spec should be a short addition to the existing one-liner. iterate a bit on your implementation until it's as short and simple as possible.

Done in e77159e. Replaced the multi-line strip_date helper with | sed 's/\*Last updated:[^*]*\*//' piped directly onto the existing python3 -m json.tool --sort-keys one-liner — net change is 1 line added, 12 removed.

Copilot finished work on behalf of splch May 25, 2026 19:08
Copilot AI requested a review from splch May 25, 2026 19:08
Copy link
Copy Markdown
Collaborator

@splch splch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great that's closer! thank you. now make it DRY

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

great that's closer! thank you. now make it DRY

Done in c5bd46a. Extracted the repeated pipeline into a one-line norm() shell function — the diff call now reads <(norm openapi.json) <(norm /tmp/latest-spec.json).

Copilot AI requested a review from splch May 25, 2026 19:11
Copilot finished work on behalf of splch May 25, 2026 19:11
Copy link
Copy Markdown
Collaborator

@splch splch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use perl and follow existing patterns and styles to ensure the pr is short and simple.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

use perl and follow existing patterns and styles to ensure the pr is short and simple.

Done in a5f2fd4 — swapped sed for perl -pe in the norm() helper. The rest of the step is unchanged.

Copilot finished work on behalf of splch May 25, 2026 19:15
Copilot AI requested a review from splch May 25, 2026 19:15
Copy link
Copy Markdown
Collaborator

@splch splch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use jq -S instead of python's json.tool? now try to make these lines as short as possible.

Copilot finished work on behalf of splch May 26, 2026 15:46
Copilot AI requested a review from splch May 26, 2026 15:46
@splch splch marked this pull request as ready for review May 26, 2026 19:21
@splch splch requested a review from a team as a code owner May 26, 2026 19:21
Copilot finished work on behalf of splch May 26, 2026 19:22
Copilot finished work on behalf of splch May 26, 2026 19:29
Copy link
Copy Markdown
Collaborator

@splch splch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace the gsub with del(.info.description)

Copilot finished work on behalf of splch May 26, 2026 19:31
Copilot AI requested a review from splch May 26, 2026 19:31
Copy link
Copy Markdown

@natestemen natestemen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! The description only contains the date or is there other info that is also being dropped?

@splch
Copy link
Copy Markdown
Collaborator

splch commented May 27, 2026

@natestemen dropping the description field ignores metadata (like dates, product blurbs, status page info, notes for humans, etc) about the spec which is fine since we care about breaking contract changes

@splch splch merged commit ef750f1 into main May 27, 2026
12 checks passed
@splch splch deleted the copilot/update-openapi-spec-client branch May 27, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI spec has changed upstream

3 participants